Skip to content

Add navigation tests for Operators Index Page buttons and table interactions#749

Merged
StuartFerguson merged 3 commits intomainfrom
copilot/improve-code-coverage-operators
Feb 6, 2026
Merged

Add navigation tests for Operators Index Page buttons and table interactions#749
StuartFerguson merged 3 commits intomainfrom
copilot/improve-code-coverage-operators

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 6, 2026

The Operators Index Page lacked tests for button interactions and navigation flows, unlike the Estate Index Page which served as the reference implementation.

Changes

Added 5 test methods to OperatorsIndexPageTests.cs:

  • Button navigation tests: "Add New Operator", View (eye icon), and Edit buttons
  • Table row click navigation: Verify row clicks navigate to operator detail page
  • Error handling: Verify navigation to error page on load failure

Implementation

Tests use the same pattern as Estate Index Page:

// Locate elements via FindAll() + FirstOrDefault()
var buttons = cut.FindAll("button");
var viewButton = buttons.FirstOrDefault(b => b.GetAttribute("title") == "View");
viewButton.ShouldNotBeNull(); // Explicit assertion before interaction
viewButton.Click();

// Verify navigation with FakeNavigationManager
_fakeNavigationManager.Uri.ShouldContain($"/operators/{operatorId}");

Each test properly waits for loading states and includes explicit null checks to provide clear failure messages when elements aren't found.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • f.feedz.io
    • Triggering command: /usr/bin/dotnet dotnet test EstateManagementUI.BlazorServer.Tests/EstateManagementUI.BlazorServer.Tests.csproj --filter FullyQualifiedName~OperatorsIndexPageTests --verbosity normal (dns block)
    • Triggering command: /opt/hostedtoolcache/CodeQL/2.24.0/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp /opt/hostedtoolcache/CodeQL/2.24.0/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp (dns block)
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/EstateManagementUI/EstateManagementUI/EstateManagementUI.sln --packages /home/REDACTED/work/EstateManagementUI/.codeql-scratch/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/home/REDACTED/work/EstateManagementUI/.codeql-scratch/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/home/REDACTED/work/EstateManagementUI/.codeql-scratch/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Improve Code Coverage on Operators Index Page</issue_title>
<issue_description>Use the estate index page tests as a guide on how to find buttons and also verify navigation</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 6, 2026 17:10
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
…assertions

Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve code coverage on operators index page Add navigation tests for Operators Index Page buttons and table interactions Feb 6, 2026
Copilot AI requested a review from StuartFerguson February 6, 2026 17:16
@StuartFerguson StuartFerguson marked this pull request as ready for review February 6, 2026 18:09
@StuartFerguson StuartFerguson merged commit 609b610 into main Feb 6, 2026
10 checks passed
@github-actions github-actions Bot deleted the copilot/improve-code-coverage-operators branch April 8, 2026 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Code Coverage on Operators Index Page

2 participants